// ~/composables/useNavigation.ts
export const useNavigation = () => {
  const router = useRouter()

  const back = (fallback?: string) => {
    if (window.history.state.back) {
      router.back()
    } else if (fallback) {
      navigateTo(fallback)
    }
    // 什么都不做（保持当前页）
  }

  return { back }
}